﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kaiser.Models;
using Kaiser.Modules.Hiner.Models.Order;
using Kaiser.Services;


namespace Kaiser.Repositories.EF
{
    public abstract class RepositorieBase<T> : IRepositorieBase<T> where T : class
    {
        protected virtual string Prefix
        {
            get { return typeof(T).Name; }
        }
        protected abstract string MapPath { get; }
      
        public void Insert(T model)
        {

            //BatisHepler.ExcuteInsert(Prefix + ".Insert", model);
        }

        public void Update(T model)
        {

          //  BatisHepler.ExcuteUpdate(Prefix + ".Update", model);
        }

        public int Delete(object primaryId)
        {

            return 0;
        }

        public T Get(object primaryId)
        {

            return null;
        }

        public int DeleteList(IList<string> ids)
        {

            return 0;
        }

        public virtual Models.DataGrid<T> Search(Object search, Models.PagingInfo pageinfo)
        {
 
            //int totalCount = 0;

            //var list = BatisHepler.ExcuteSelectForList<T>(Prefix + ".Search", search, pageinfo.Size, pageinfo.Index + 1, out totalCount);


            //var result = new DataGrid<T>(list, pageinfo);
            //result.total = totalCount;

            //return result;
            return null;
        }
    }
}
